Static method and variables in c#
1692
25-Nov-2015
I want to know what is Static method and variables in c# and how to use please help me.
Anonymous User
25-Nov-2015Whenever you write a function or declare a variable, it doesn’t create instance in a memory until you create object of class. But if you declare any function or variable with static modifier, it directly create instance in a memory and acts globally. The static modifier doesn’t reference with any object.
It is very easy to create static modifier with variables, functions and classes. Just put static keyword before the return data type of method.